<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <title>扫描批次码</title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
    <!-- 引入YDUI样式 -->
    <!--<link href="https://static.9hive.cn/global/vendor/ydui/css/ydui.css" rel="stylesheet">-->
    <!-- 引入jQuery 2.0+ -->
    <script src="https://static.9hive.cn/global/vendor/jquery/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="https://static.9hive.cn/global/vendor/jquery-cookie/jquery.cookie.js"></script>
    <style>
        body{
            background-color: #ebeef7;

        }
        .text-align{
            font-size: 15px;
            padding: 20px;
        }
        .text-align>.oneDiv{
            display: flex;
            padding-top: 10px;
        }
        .oneDiv>div:nth-child(1){
            text-align: right;
            padding-right: 20px;
            flex: 1;
            white-space:nowrap;/*强制不换行*/
        }

        .oneDiv>div:nth-child(2){
            flex: 1;
            text-align: left;
        }
        .div>._oneDiv{
            word-break:break-all;/*只对英文起作用，以字母作为换行依据*/
            white-space:pre-wrap;/*只对中文起作用，强制换行*/
            display: flex;
        }
        /*.div>_oneDiv>div:nth-child(1){
            white-space:nowrap;
        }
        .div>._oneDiv>div:nth-child(2){
            flex: 1;
        }*/
    </style>
</head>
<body>
<div class="text-align">
    <div class="oneDiv">
        <div>批次号：</div>
        <div>${batch.batch_code!}</div>
    </div>
    <div class="oneDiv">
        <div>批次描述：</div>
        <div>${batch.description!}</div>
    </div>
    <div class="oneDiv">
        <div>商品信息：</div>
        <div class="div">
            <div class="_oneDiv">
                <div style="white-space:nowrap; ">商品名称：</div>
                <div>${product.name!}</div>
            </div>
            <%if(product.productSn! !=null){%>
                <div class="_oneDiv">
                    <div style="white-space:nowrap; ">商品型号：</div>
                    <div>${product.productSn!}</div>
                </div>
            <%}%>
            <div class="_oneDiv">
                <div style="white-space:nowrap; ">商品规格：</div>
                <input type="hidden" value="${batch.specification_id!}" id="specification_id">
                <div id="specification">XL</div>
            </div>
        </div>
    </div>

    <div class="oneDiv">
        <div>批次内商品码数量：</div>
        <div>${batch.quantity}</div>
    </div>
    <div class="oneDiv">
        <div>生成类型：</div>
        <%if(batch.code_type! ==0){%>
        <div>内码+外码</div>
        <%}else if(batch.code_type! ==1){%>
        <div>内码</div>
        <%}else if(batch.code_type! ==2){%>
        <div>外码</div>
        <%}%>
    </div>
</div>
</body>
<!-- 引入YDUI自适应解决方案类库 -->
<script src="https://static.9hive.cn/global/vendor/ydui/js/ydui.flexible.js"></script>
<!-- 引入YDUI脚本 -->
<script src="https://static.9hive.cn/global/vendor/ydui/js/ydui.js"></script>
<script>
    $.ajax({
        type: "POST",
        url: "getSpecifications",
        data: {
            "productId":"${product.id!}",
        },
        success: function (data) {
            console.log(data)
            var  html=""
            $.each(data.data, function (index, content) {
               html+=(content.specificationValueName);
            });
            $("#specification").html(html);
        }
    });
</script>
</html>